package com.students.utils;

import com.students.pojo.Admin;
import org.springframework.security.core.context.SecurityContextHolder;

/*
* 操作员工具类
* */
public class AdminUtil {

    //获取当前登录操作员
    public static Admin getCurrentAdmin(){
        return (Admin) SecurityContextHolder
                .getContext()
                .getAuthentication()
                .getPrincipal();
    }
}
